﻿/*jslint white: true, browser: true, undef: true, nomen: true, eqeqeq: true, plusplus: false, bitwise: true, regexp: true, strict: true, newcap: true, immed: true, maxerr: 14 */
/*global window: false, REDIPS: true */

/* enable strict mode */
"use strict";
// define redipsInit variable
var redipsInit;

// redips initialization
redipsInit = function () {
    var rd = REDIPS.drag;
    
    rd.init();    
    //REDIPS.drag.mark.action = 'allow';    // khong cho drop vao phan tu nao tren bang
    //rd.clone.drop = true;
    // xu ly su kien khi drop ve nut cu
    //rd.event.dropped = function () {
    //    var oj = document.getElementById(rd.obj.id);
    //    var parent = oj.parentElement;
    //    for (var i = 2; i < parent.childElementCount; i++) {
    //        var childrenId = parent.children[i].id;
    //        if (childrenId != oj.id) {
    //            if (oj.id.substring(0, childrenId.length) == childrenId) {
    //                oj.id = childrenId;                    
    //                oj.classList.add("clone");
    //                oj.classList.add("climit2_1");
    //                parent.removeChild(parent.children[i]);                    
    //            }
    //        }            
    //    }        
    //};  
};

// add onload event listener
if (window.addEventListener) {
    window.addEventListener('load', redipsInit, false);
}
else if (window.attachEvent) {
    window.attachEvent('onload', redipsInit);
}

